00 - RGBA4
08 - RGBA8
10 - RGB5A1
18 - RGBA32
40 - CI4
48 - CI8
50 - CI16
60 - IA4
68 - IA8
70 - IA16
80 - I4
88 - I8
90 - I16


10 rgb5a1
18 rgba32
70 ia4
70 ia8
70 ia16
90 i4
90 i8

8023BB4C title screen fire JAL
8023BC08 title screen logo JAL
8023BD84 title screen tlo shadow JAL
8023BDD0 title screen oot shadow JAL
8023BE84 title screen tlo text JAL
8023BEC8 title screen oot text JAL
8023BF3C title screen mq logo JAL
8023C414 title screen press start shadow JAL
8023C4EC title screen press start text JAL


0031BB60 link
00326EC0 link display lists

001B6E78 inventory top left




802C5880 Nintendo_rogo_static start in RAM
802C8020 Nintendo Logo Display List
800A19C8 something
800A1934 game boots here????

00016E60 File Table set end to 00820480

003E9514 inventory top left texture 0x0D018580
8033F108
80388E20 inventory top left texture
8038D420 save texture
80398720 another language

003E95C8 save screen textures
801CADB0 texture display list
803DED5C texture format
803DED58 texture byte size

800BF264 link ragdoll is generated somewhere around here
800C6C2C function to start ragdoll display list

800BF2D8 size of generated jpeg image 

800C170C GENERATE IMAGE
800BF980 generate pause menu debug screen
803DDE04 generate pause menu background

803E5AE0 make item icons greyscale if they aren't usable

800BF9B8 remove this and screen wont go black when you open pause menu

002228A8 where icon_item_static is loaded into RAM
002228AC where icon_item_24_static is loaded into RAM
002228B0 where icon_item_field_static is loaded into RAM
002228B4 where icon_item_nes_static is loaded into RAM
002228B8 where item_name_static is loaded into RAM
002228BC where map_name_static is loaded into RAM

0x803E509C make rgba32 texture greyscale
	A0 = Texture Address
	A1 = Texture Pixels

02  inline scene
03  inline map
04  gameplay_keep
05  gameplay_field_keep OR gameplay_dangeon_keep
06  inline obj (current zobj)
07+  inline actor (current actor)






801790D0 background color
8017916C function call for upper text
803DA800 texture start in RAM

803e0c40 text start debug
803D7400 text before conversion

801B4870 write texture debug

801B4BA0 branch if you have expansion pak

0x00BB1320 Yaz0 block containing Expansion Pak message on MM PAL

0x80000318 amount of RAM available in a n64 game

800819F8 Convert Yaz0 block
	A0 = Yaz0 block start
	A2 = Yaz0 block length


800819F8

8008130C function start

Miscellaneous Notes
-----------------------------------------------------
All values are big endian.
Files in filesystem are padded to 16-byte boundaries.
The N64 has hardware support for texture stretching. So, when ripping textures, you may find that some of them contain 'garbled blocks' of data. The 'perfect' part of the texture should be stretched to fit the entire texture.
Despite what some sources say, display lists do not always begin with an E7 instruction. In fact, there is really no consistency for the ordering of the instructions at the start of a display list. However, E7 syncs the drawing with the pipe-renderer, so it commonly occurs before any drawing instructions, which is why software written to view them so far can show most display lists without any problems. Perhaps the best way to determine the start of the display lists is to build a memory map for the entire file using E7 as the start of the display lists to begin with, then moving the start addresses backward to fill the 'gaps' in memory.

GameShark Code
-----------------------------------------------------
Code:
 
Format: ttoooooo vvvv
     t - type 80 = replace 1 byte
     81 = replace 2 bytes
     D0 = if value at 'o' is equal to 'v'
          then execute next code
     o - address in memory
     v - value to write at address



Banks
-----------------------------------------------------
Code:
 
02  inline scene
03  inline map
04  gameplay_keep
05  gameplay_field_keep OR gameplay_dangeon_keep
06  inline obj (current zobj)
07+  inline actor (current actor)



Texture Formats
-----------------------------------------------------
Code:
 
00 - RGBA4
08 - RGBA8
10 - RGBA16
18 - RGBA32
40 - CI4
48 - CI8
50 - CI16
60 - IA4
68 - IA8
70 - IA16
80 - I4
88 - I8
90 - I16



Vertex Formats
-----------------------------------------------------
Code:
 
Display List Vertex
Format: zzzz yyyy xxxx 0000 uuuu vvvv rr gg bb aa
     x - x position of vertex, signed 16-bit integer
     y - y position of vertex, signed 16-bit integer
     z - z position of vertex, signed 16-bit integer
     u - horizontal position of uv coord
     u = u * (textureWidth / 32) * 1024
         to reverse; u = (u / 1024) / (textureWidth / 32)
     v - vertical position of uv coord
     v = v * (textureHeight / 32) * 1024
         to reverse; v = (v / 1024) / (textureHeight / 32)



Hierarchy Format
-----------------------------------------------------
Code:
 
Limbs Entry
Format: zzzz yyyy xxxx cc ss ffffffff nnnnnnnn
     x - x position of limb
     y - y position of limb
     z - z position of limb
     c - index of child limb (0xFF = no child)
     s - index of next sibling limb (0xFF = no sibling)
     f - offset of far display list in bboooooo format,
         where b = bank and o = offset
     n - offset of near display list in bboooooo format,
         where b = bank and o = offset


Limb Index
Format: bb oooooo
     b - bank where limb entry is stored
     o - offset of limb entry


Hierarchy Header
Format: bb oooooo nn 000000 dd 000000
     b - bank where limb indices are stored
     o - offset of limb indices
     n - number of limbs
     d - number of display lists



Beta Hierarchy Format
-----------------------------------------------------
Code:
 
Limb Entry
Format: dddddddd zzzzzzzz yyyyyyyy xxxxxxxx vvvv uuuu tttt 0000 cccccccc ssssssss
     d - display list
     x - x position of limb (32-bit float)
     y - y position of limb (32-bit float)
     z - z position of limb (32-bit float)
             t - default x rotation
             u - default y rotation
             v - default z rotation
     c - pointer to child limb
     s - pointer to sibling limb



Loading Patterns
-----------------------------------------------------
Code:
 
Pipe Sync:  E7, E3, D7
Palettes:  FD, E8, F5, E6, F0, E7
Textures:  FD, F5, E6, F3, E7, F5, F2



F3DZEX2 Instructions
-----------------------------------------------------
Code:
 
00 NOP (No Operation)
Format: [00 00 00 00 00 00 00 00]

[code]01 Set Vertex Buffer
Format: [01 aa ac cc bb xx xx xx]
     a - where to start writing vertices in buffer,
         index = c-a
     c - number of vertices to write * 2
     b - bank
     x - offset

05 Draw 1 Triangle
Format: [05 aa bb cc 00 00 00 00]
     a - first vertex of triangle * 2
     b - second vertex of triangle * 2
     c - third vertex of triangle * 2

06 Draw 2 Triangles
Format: [06 aa bb cc 00 dd ee ff]
     a - first vertex of first triangle * 2
     b - second vertex of first triangle * 2
     c - third vertex of first triangle * 2
     d - first vertex of second triangle * 2
     e - second vertex of second triangle * 2
     f - third vertex of second triangle * 2

07 Draw Quad
Format: [07 aa bb cc 00 dd ee ff]
     a - first vertex of top-left corner of quad * 2
     b - second vertex of top-left corner of quad * 2
     c - third vertex of top-left corner of quad * 2
     d - first vertex of bottom-right corner of quad * 2
     e - second vertex of bottom-right corner of quad * 2
     f - third vertex of bottom-right corner of quad * 2

D9 Set F3DZEX Mode
Format: [D9 aa bb cc 00 00 00 00]
     aa = vertex colors (FF = disabled  00 = enabled)
     bb = double-sided faces (FF = disabled  FB = enabled)
     cc = overlapping (FF = disabled  00 = enabled)

DA Set Matrix (NOT 100% CORRECT YET)
Format: [DA 00 00 00 ss xx xx xx]
     s - (length of matrix / 112)
     x - offset

DE Call Display List / Function
Format: [DE 00 00 00 bb xx xx xx]
     b - bank
     x - offset

800BF1F4

DF End of Display List
Format: [DF 00 00 00 00 00 00 00]

E2 Set Geometry Location (so game does not load if out of range)
Format: [E2 00 nn nn nn ff ff ff]
     n - near distance
     f - far distance

E6 Unknown
Format: [E6 00 00 00 00 00 00 00]

E7 Sychronize Drawing With Pipe Renderer (Usually Start of Display List)
Format: [E7 00 00 00 00 00 00 00]

E8 Unknown
Format: [E8 00 00 00 00 00 00 00]

F2 Set Tile Size (scale tile?)
Format: [F2 aa ab bb nn cc cd dd]
     a - x1 offset << 2
     b - y1 offset << 2
     n - tile #
     c - x2 offset << 2
     d - y2 offset << 2

F3 Load Block
Format: [F3 00 00 00 nn aa ab bb]
     n - tile #
     a - (texture size in bytes / 2) - 1
     b - ???????????????????????????????????????

F4 Load Tile (set tile offset?)
Format: [F4 aa ab bb nn cc cd dd]
     a - x1 offset << 2
     b - y1 offset << 2
     n - tile #
     c - x2 offset << 2
     d - y2 offset << 2

F5 Set Tile Properties
Format: [F5 tt 00 00 nn 00 00 00]
     t - image type
     n - tile #

F6 Fill Rectangle
Format: [F6 aa ab bb 00 cc cd dd]
     a - x1 offset << 2
     b - y1 offset << 2
     c - x2 offset << 2
     d - y2 offset << 2

F7 Set Fill Color
Format: [F7 00 00 00 aa aa bb bb]
     a - fill color in 5551 format
     b - same as 'a'

FC Set Combiner

FD Set Tile Image
Format: [FD tt 00 7F xx xx xx xx]
     t - image format
     x - offset